package com.doone.telmarket.infrastructure.dao.impl;

import org.springframework.stereotype.Service;

import com.doone.telmarket.domain.ServicePageContent;
import com.doone.telmarket.infrastructure.dao.BaseDaoSupport;
import com.doone.telmarket.infrastructure.dao.ServicePageContentDao;

@Service("servicePageContentDao")
public class ServicePageContentDaoImpl extends BaseDaoSupport implements ServicePageContentDao {

	public void deleteByPrimaryKey(int key) {
		getSqlMapClientTemplate().delete("ServicePageContent.deleteServicePageContentByPrimaryKey", key);
	}

	public void deleteByServicePageCode(Integer servicePageCode) {
		getSqlMapClientTemplate().delete("ServicePageContent.deleteServicePageContentByServicePageCode",
				servicePageCode);
	}

	public ServicePageContent saveServicePageContent(ServicePageContent servicePageContent) {
		int newKey = (Integer) getSqlMapClientTemplate().insert("ServicePageContent.saveServicePageContent",
				servicePageContent);
		servicePageContent.setContentId(newKey);
		return servicePageContent;
	}

	public ServicePageContent selectServicePageContentByPrimaryKey(int key) {
		return (ServicePageContent) getSqlMapClientTemplate().queryForObject(
				"ServicePageContent.selectServicePageContentByPrimaryKey", key);
	}

	public void updateServicePageContent(ServicePageContent spc) {
		// TODO Auto-generated method stub 
		getSqlMapClientTemplate().update("ServicePageContent.updateServicePageContent", spc);
	}

}
